﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace CodeBadger.GasMileage.Converters
{
    public class NoZerosConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null) return null;
            return value.ToString() == "0" ? "" : value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }
    }
}
